package com.xxx.mch.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * @author FengHaixin
 * @description 一句话描述该文件的用途
 * @date 2019-08-09
 */
@Getter
public class BusinessException extends RuntimeException
{
    private HttpStatus httpStatus;

    private String message;

    private Throwable throwable;


    public BusinessException(String message)
    {
        this(HttpStatus.INTERNAL_SERVER_ERROR, message);
    }


    public BusinessException(HttpStatus httpStatus, String message)
    {
        super(message);
        this.message = message;
        this.httpStatus = httpStatus;
    }


    public BusinessException(String message, Throwable cause)
    {
        this(HttpStatus.INTERNAL_SERVER_ERROR, message, cause);
    }


    public BusinessException(HttpStatus httpStatus, String message, Throwable cause)
    {
        super(message, cause);
        this.httpStatus = httpStatus;
        this.message = message;
        this.throwable = cause;
    }
}
